1. Field of the Invention
The present invention relates to a method and apparatus for synchronously reproducing a compressed audio data and video data.
2. Description of the Related Art
Conventionally, as a reproduce technique of a video data and an audio data, there is known an audio data and video data reproducing system, in which the audio data and video data which have been digitally coded and compressed, like an MPEG (Moving Picture Expert Group) data are respectively expanded. In this system, the synchronization between the audio data and the video data (to be referred to as AV synchronization, hereinafter) is generally controlled, using time stamps which are written in the data.
However, there is a case that it is not possible to perform the AV synchronization control correctly in accordance with the time stamps which have been written in the data, when a time resolution of the reproducing system is low.
In order to avoid such a problem, the following method is proposed. That is, an audio reproduction time is calculated from a bit rate which has been written in the audio data, and a reproduce byte count. The number of frames to be outputted till the present time after the start of the reproduction is calculated based on the calculated audio reproduction time and the frame rate which has been written in the video data. The calculated number of frames and the number of frames which have been actually outputted are compared with each other and the AV synchronization is controlled based on the comparing result.
Also, a 24-frame/sec data such as a movie data shown in FIG. 1A is converted into a 60-field/sec data of the NTSC system shown in FIG. 1B by the known 3:2 pull down. In this case, a frame rate of 30 frames/sec is written in the converted data. The converted data by the 3:2 pull down has been processed to be reproduced in an interlace display mode. The converted data is converted into the data of a frame structure shown in FIG. 1C, and displayed in the frame rate of 30 frames/sec which has been written in the data, when being reproduced in the non-interlace display mode.
However, when the data expanding process of a data and the AV synchronization control are realized with a software, a great deal of time is spent on the video data processing, if a CPU and a graphic process in the reproducing system are not highly efficient. Therefore, it is necessary to frequently perform the intermittent removal of the frames for control of the AV synchronization.
In order to avoid this problem, it could be considered that the data of the field structure is not expanded in the 30 frames/sec but in the original 24 frames/sec. In this case, the frame rate which has been written in the video data and the actual frame rate are different from each other. Therefore, the time stamps which have been written in the data must be used for the AV synchronization.
In conjunction with the above, a video and audio data reproducing system is disclosed in Japanese Laid Open Patent application (JP-A-Heisei 8-251543). In this reference, time data for a video data and an audio data are calculated in units of frames based on a frame update data and a frame rate data. The time data are compared with each other to determine whether the reproduction of the video data proceeds more than that of the audio data.
Also, an MPEG system decoder is disclosed in Japanese Laid Open Patent applications (JP-A-Heisei 8-212701 and JP-A-Heisei 8-214296). In this reference, reproduction times are set based on decoding operation times of decoders (2, 3) and SCR and PTS for each register (11, 21). The PTS is read out from each register and transferred to a corresponding control circuit. Bit streams are transferred from bit buffers to decode core circuits (13, 23). Each of the control circuit calculates the reproduction time based on the decode operation time of the decoder, and SCR and PTS.
A signal processing method is described in Japanese Laid Open Patent application (JP-A-Heisei 6-343065). In this reference, a decoding system for a compressed vide signal and a compressed audio signal includes a local access unit counter for a digital AV application. An access unit header is generated and lost due to a storage media error or a transmission error there. A value called an access unit count is included in each of elementary streams to suppress the generation of an AV sync error. The value is stored in a register (238, 244). An encoder (228, 230) detects the loss of the access unit header or an error of that to correct AV synchronization.
Therefore, an object of the present invention is to provide a method and apparatus for synchronously reproducing an audio data and video data, in which AV synchronization control of the audio data and the video data can be performed without using a frame rate which has been written in the video data, when the audio data and video data which have been digitally compressed, like an MPEG data, are expanded and reproduced, respectively.
In order to achieve an aspect of the present invention, an apparatus for synchronously reproducing a video data and audio data, includes a separating section, an audio data processing section, a video data processing section, and a synchronization processing section. The separating section separates a multiplexed compressed audio and video data into a compressed video data and a compressed audio data. The audio data processing section expands the compressed audio data to reproduce an audio data from the expanded audio data, and outputs the audio data to the synchronization processing section. The video data processing section expands the compressed video data in response to a control signal to reproduce a video data from the expanded video data, and outputs a signal indicative of each of frames, and a signal indicative of each of time stamps to the synchronization processing section. The synchronization processing section calculates a frame rate based on the audio data supplied from the audio data processing section, and the frame signal and the time stamp signal supplied from the video data processing section, and outputs the control signal to the video data processing section based on the calculated frame rate without using a frame rate written in the video data.
In this case, the synchronization processing section includes a time stamp monitoring section calculating a time difference between the two time stamps, a frame difference counter counts a number of frames between the two time stamps, a calculating section calculating the frame rate from the number of frame difference and the time difference, and a control section outputting the control signal to the video data processing section based on the calculated frame rate.
In order to achieve another aspect of the present invention, a method of synchronously reproducing a video data and audio data, includes:
separating a multiplexed compressed audio and video data into a compressed video data and a compressed audio data;
expanding the compressed audio data to reproduce an audio data from the expanded audio data;
a video data processing section expanding the compressed video data in response to a control signal to reproduce a video data from the expanded video data;
generating a signal indicative of each of frames, and a signal indicative of each of time stamps;
calculating a frame rate based on the audio data, the frame signal and the time stamp signal; and
generating the control signal based on the calculated frame rate without using a frame rate written in the video data.